/**
 * Created by Administrator on 2016/11/16.
 */
// 链接数据库
//     1.引入数据库文件
var settings =requrie('../setting');
// 2.引入链接数据库的mongodb模块
var Db = require('mongodb').Db;
var Connection = require('mongodb').Connection;
var Server  = require('mongodb').Server;

// 3.创建数据库链接对象
module.exports = new Db(settings.db,
    new Server(settings.host,settings.port),
    {safe:true}
)